package com.bjpowernode.exception;

public class ExceptionResult {
    private Integer code;
    private String message;

    private ExceptionResult(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "ExceptionResult{" +
                "code=" + code +
                ", message='" + message + '\'' +
                '}';
    }

    public static ExceptionResult error(Integer code,String message){
        return new ExceptionResult(code,message);
    }
    public static ExceptionResult success(){
        return new ExceptionResult(0,"success");
    }
}
